﻿<!--{inc(header.view.html)}-->

<div class="content" id="content">
	<div class="top-menu-box">
    	<div class="z">
            <span class="z-f"><a href="#">网站设置</a>&nbsp;&gt;</span>
            <span class="z-f"><a href="#">Icondata数据修改</a></span>
            <div class="z-f-r"><span class="user-t"><a href="{$site_url}"  target="_blank">网站首页</a></span><span class="user-info"></span><a href="index.php?app=default&act=quit" onClick="return confirm('确认退出管理系统吗？');"   >退出管理</a></div>
        </div>
        <div class="top-menu">
        	<ul>
	
				
				
                                                 <li><a href="index.php?app=icon&act=index"  target="mainframe">Icon列表</a></li>
												 <li><a href="index.php?app=icon&act=add"  target="mainframe">Icon添加</a></li>
                                                 <li><a href="index.php?app=icon&act=icondata" target="mainframe">Icondata数据列表</a></li>
                                                 <li><a href="index.php?app=icon&act=icondataadd"   target="mainframe">Icondata数据增加</a></li>
                                                 	<li class="current"><a href="#" >Icondata数据修改</a></li>	
												 <li><a href="index.php?app=icon&act=iconhtml"  target="mainframe">Iconhtml数据列表</a></li>
                                                 <li><a href="index.php?app=icon&act=iconhtmladd"  target="mainframe">Iconhtml数据增加</a></li>
				
				
				
				
            </ul>
            <div class="clear"></div>
        </div>
    </div>
    
    <div class="main">
	
	
<?php if ($type =='data' ) { ?>

<table  class="data" >
<tbody>
  <form id="form1" name="formscup" method="post" action="?app=icon&act=icondataeditpost">

<tr  onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">
	<td width="20%">Icondata名称(即属性icondata文件名):</td>
	<td><input type="text" maxlength="50" value="{$id}" name="name"></td>
</tr>
<tr  onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">
	<td>Icondata描述:</td>
	<td><input type="text" maxlength="20" value="{$description}"  size="50" name="description"></td>
</tr>

   <tr > 
      <td width="20%" >默认是显示一项。你可以设置更多。。</td>
      <td> 再增加几项 
        <input type="text" size="3" name=nums value="2">
        <input type="button" name="Submit2" value="增加" class="buton" onClick=showinput()>
      </td>
    </tr>
    <tr> 
      <td ><font color="#FF0000">注意:<b><font color="#0000FF">不填文字介绍也可以</font></b></font></td>
      <td >
       <!---->
      <?php foreach((array)$data as $_key => $_value ) { ?>

	   数组键名key({$_key}):    <input type="text"  value="{$_value.datakey}"  name="data[{$_key}][datakey]"  size="40" id="UP_id_{$_key}"><br/>
        数组值value:      <input type="text" name="data[{$_key}][datavalue]" size="40" value="{$_value.datavalue}"><br><hr size='1'>
     <?php } ?>

        <!---->

        <br>
        <div id=input></div>
       
        <p>&nbsp;</p>
      </td>
    </tr>

    <tr > 
      <td >&nbsp;</td>
      <td >
	  <input type="hidden" name="id" value="{$id}" />
	  <input type="hidden" name="type" value="data" />
        <input type="submit" name="Submit" class="buton" value="提交"  />

<script>
function showinput(){
	var str=input.innerHTML;
	var num=2;
	var N=0;
	num=document.formscup.nums.value;
	oo=document.body.getElementsByTagName("input");
	for(var j=0;j<oo.length;j++){
		if(oo[j].getAttribute("name").indexOf('data')==0){
			N++;
		}
	}
	for(var i=0;i<num;i++){
		N++;
		str+='数组键名key('+N+'):　　 <input type="text"  value=""  name="data['+N+'][datakey]"  size="40"   id="UP_id_'+N+'"><br/>';
		str+='数组值value:　　<input type="text" name="data['+N+'][datavalue]" size="40" value="" ><br><hr size=1>';
	}
	input.innerHTML=str;
}


</script>

      </td>
    </tr>
  </form>
</tbody>
</table> 

<?php } elseif ($type == 'file' )  { ?>

<table  class="data" >
<tbody>
  <form id="form1" name="formscup" method="post" action="?app=icon&act=icondataeditpost">

<tr  onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">
	<td width="20%">Icondata名称(即属性icondata文件名):</td>
	<td><input type="text" maxlength="50" value="{$id}" name="name"></td>
</tr>
<tr  onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">
	<td>Icondata描述:</td>
	<td><input type="text" maxlength="20" value="{$description}"  size="50" name="description"></td>
</tr>

   <tr > 
      <td width="20%" >默认是显示一项。你可以设置更多。。</td>
      <td> 再增加几项 
        <input type="text" size="3" name=nums value="2">
        <input type="button" name="Submit2" value="增加" class="buton" onClick=showinput()>
      </td>
    </tr>
    <tr> 
      <td ><font color="#FF0000">注意:<b><font color="#0000FF">不填文字介绍也可以</font></b></font></td>
      <td >

      <?php foreach((array)$data as $_key => $_value ) { ?>

	   文件地址(0):    
       <input type="text"  value="{$_value.upfile}"  name="data[{$_key}][upfile]"  size="40"   id="UP_id_{$_key}"><br/><iframe name="MF_id_{$_key}"  frameborder=""  height="100"  scrolling="no"  width="370"  src="?app=icon&act=upfile&jsfun=UPF_upfile&uppic=UP_id_{$_key}&picurl={$_value.upfile}&edit=edit&id={$idtime}" ></iframe><br>
        文件介绍:　　 
        <input type="text" name="data[{$_key}][description]" size="40" value="{$_value.description}">
        <br>
        <hr size='1'>

    <?php } ?>
        <!---->

        <br>
        <div id=input></div>
       
        <p>&nbsp;</p>
      </td>
    </tr>

    <tr > 
      <td >&nbsp;</td>
      <td >	  <input type="hidden" name="id" value="{$id}" /> <input type="hidden" name="type" value="file" />
        <input type="submit" name="Submit" class="buton" value="提交"  />

<script>
function showinput(){
	var str=input.innerHTML;
	var num=2;
	var N=0;
	num=document.formscup.nums.value;
	oo=document.body.getElementsByTagName("input");
	for(var j=0;j<oo.length;j++){
		if(oo[j].getAttribute("name").indexOf('data')==0){
			N++;
		}
	}
	for(var i=0;i<num;i++){
		N++;
		str+='文件地址:('+N+')　　 <input type="text"  value=""  name="data['+N+'][upfile]"  size="40"   id="UP_id_'+N+'"><br/><iframe name="MF_id_'+N+'"  frameborder=""  height="100"  scrolling="no"  width="370"  src="?app=icon&act=upfile&jsfun=UPF_upfile&uppic=UP_id_'+N+'&picurl=&edit=edit&id={$idtime}" ></iframe><br>';
		str+='文件介绍:　　<input type="text" name="data['+N+'][description]" size="40" value=""><br><hr size=1>';
	}
	input.innerHTML=str;
}

function UPF_upfile(url,b)
{
	document.getElementById(b).value=url;
} 

</script>

      </td>
    </tr>
  </form>
</tbody>
</table>
<?php } else { ?>

<table  class="data" >
<tbody>                               
 <tr  onMouseOut="this.className=''" onMouseOver="this.className='bgcolor'">
	<td>Icondata数据创建:</td>
	<td>  
          <select name='type' onChange="window.location.href='?app=icon&act=icondataadd&type='+this.options[this.selectedIndex].value">
		  <option value="0" >请选择数据类型...</option>
          <option value="file" >文件数据</option>
          <option value="data" >一般数据</option> 
          </select>
</td>
</tr>                                
</tbody>
</table>







<?php } ?>

                               
 	


        
        <div class="notic"><img  src="{$web_view_dir}style/images/light.gif" align="absmiddle" /> <b>提示: </b> <span ></span></div>
    </div>
</div>
<!--{inc(footer.view.html)}-->